package com.example.entity.vo;

import com.example.entity.H5QuestionnaireVarieties;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * (H5Questionnaire)实体类
 *
 * @author makejava
 * @since 2020-10-29 10:56:31
 */
@Data
@NoArgsConstructor
public class H5QuestionnaireVO implements Serializable {
    private static final long serialVersionUID = -74691383297159250L;

    private Integer id;
    private Integer userId;
    /**
     * 是否有贷款需求  0否 1是
     */
    private Integer isLoanDemand;
    /**
     * 预约金额
     */
    private Double loanAmount;
    /**
     * 年化利率
     */
    private Double loanRate;
    /**
     * 贷款用途
     */
    private String loanPurpose;
    /**
     * 贷款期限
     */
    private Integer loanTerm;
    /**
     * 不贷款的原因
     */
    private String loanNoDemandReason;
    /**
     * 以前是否获得过贷款  0否  1是
     */
    private Integer isGetLoan;
    /**
     * 省农担公司是否为您提供过贷款担保服务
     */
    private String isGetWarrant;
    /**
     * 最近一次获得贷款的额度(万元)
     */
    private Double lastGetLoan;
    /**
     * 贷款来源
     */
    private String loanResource;
    /**
     * 贷款是靠什么获得
     */
    private String loanDepend;
    /**
     * 放款方式
     */
    private String loanWay;
    /**
     * 贷款是怎么用的
     */
    private String loanUse;
    /**
     * 贷款到期是否还款
     */
    private String loanRepay;
    /**
     * 没有贷款的原因
     */
    private String noLoanReason;
    /**
     * 银行不给贷的原因
     */
    private String bankRejectReason;
    /**
     * 是否投保了农业保险  0否 1是
     */
    private Integer isInsureFarm;
    /**
     * 投保渠道
     */
    private String insureWay;
    /**
     * 投保品种
     */
    private String insureVarieties;
    /**
     * 未投保或不再续保农业保险主要原因
     */
    private String noInsureReason;
    /**
     * 农业保险改进建议
     */
    private String improveSuggest;
    /**
     * 政府加强金融相关的支持或服务
     */
    private String governmentSuggest;

    List<H5QuestionnaireVarieties> varietiesList;

    private LocalDateTime createtime;

    private String contact;//手机号
    private String farmName;//主体名称
    private String farmer;//法人姓名
    private Integer isHzs;//主体类型
    private Integer level;//等级
    private String province;
    private String city;
    private String district;
    private Integer isAuthed;//认证状态
    private String idNum;
    private String birthday;
    private String education;//学历
    private String industryType;//经营类型

    public String getIsHzs() {
        String content = null;
        if (isHzs != null) {
            switch (isHzs) {
                case 0:
                    content = "家庭农场";
                    break;
                case 1:
                    content = "合作社";
                    break;
                case 2:
                    content = "普通农户";
                    break;
                case 3:
                    content = "农业企业";
                    break;
                case 4:
                    content = "种养大户";
                    break;
                case 5:
                    content = "联合社";
                    break;
                default:
                    content = isHzs.toString();
                    break;
            }

        }
        return content;
    }

    public String getLevel() {
        String content = null;
        if (level != null) {
            switch (level) {
                case 0:
                    content = "普通";
                    break;
                case 1:
                    content = "县级";
                    break;
                case 2:
                    content = "市级";
                    break;
                case 3:
                    content = "省级";
                    break;
                case 4:
                    content = "国家";
                    break;
                default:
                    content = level.toString();
                    break;
            }
        }
        return content;
    }

    public String getIsAuthed() {
        String content = null;
        if (isAuthed != null) {
            switch (isAuthed) {
                case 0:
                    content = "否";
                    break;
                case 5:
                    content = "待审核";
                    break;
                case 6:
                    content = "初审通过";
                    break;
                case 7:
                    content = "已认证";
                    break;
                case 8:
                    content = "审核驳回";
                    break;
                case 9:
                    content = "退回区县";
                    break;
                case 10:
                    content = "退回主体";
                    break;
                default:
                    content = isAuthed.toString();
                    break;
            }
        }
        return content;
    }

    public String getIdNum() {
        if (idNum != null) {
            char c = idNum.charAt(16);
            String sex = c % 2 == 1 ? "男" : "女";
            return sex;
        }
        return idNum;
    }
}